import nativeWebsocket from './nativeWebsocket';
import commonJS from './common';

var aipServerJs = {
  async MoreCallBack(data) {
    console.log('进入MoreCallBack');
  },

  //主接口，与exe服务交互
  async ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode) {
    sMode = sMode || '&SYNCMODE=1'; //拼模式 如&SYNCMODE=1&WNDNAME=aa&OFFICEMODE=1
    if (commonJS.PlatForm() == 'Linux') sMode = sMode + '&WNDNAME=' + document.title;
    cmddata = cmddata.replace(/&/g, '$_38_'); //转译cmd命令中携带的&符号
    var str;
    var websocketData = '/execcmd?cmdbody=CMDDATA:' + cmddata + sMode;

    var url = 'ws://127.0.0.1:13426';
    return await nativeWebsocket({
      data: websocketData,
      url: url,
      CallBack: CallBack,
    });
    // return str;
  },

  //添加当前文件的属性和值
  async DocProperty(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = "124;|;3," + p1 + "|;|3," + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    console.log("str============设置文档编号", str)
    return str;
  },

  //MonitorMode: 0-事件不终止继续, 1-事件终止
  GetMonitorServEvent(MonitorMMode, CallBack, CallData, ErrMsg, sMode) {
    sMode = sMode || '&SYNCMODE=1';
    var websocketData = '/getevent?MMode=' + MonitorMMode + sMode;
    var url = 'ws://127.0.0.1:13426';
    var str = nativeWebsocket({
      data: websocketData,
      url: url,
      listenFlag: true, //监听分支判断
      CallBack: CallBack,
    });
    return str;
  },
  async SetMonitorServEvent(MonitorEMode, CallBack, CallData, ErrMsg, sMode) {
    sMode = sMode || '&SYNCMODE=1';
    var websocketData = '/seteventmode?EMode=' + MonitorEMode + sMode;
    var url = 'ws://127.0.0.1:13426';
    var str = await nativeWebsocket({
      data: websocketData,
      url: url,
      CallBack: CallBack,
    });
    return str;
  },

  /************************************
   ***************公共方法类信息提示**************
   ************************************/
  async OutErrmsg(data) {
    if (data.errmsg != '' && data.errmsg != null) {
      //alert(data.errmsg);
      return;
    } else if (data.retstr != '' && data.retstr != null) {
      //alert(data.retstr);
      return;
    } else if (data.retcode != null) {
      //alert(data.retcode);
    }
  },
  /************************************
   ***************公共属性类信息提示**************
   ************************************/
  async attributeOutErrmsg(data) {
    if (data.retstr != '' && data.retstr != null) {
      //alert(data.retstr);
      return;
    } else if (data.retcode != null) {
      //alert(data.retcode);
    }
  },
  /************************************
   ***************默认回调函数**************
   ************************************/
  async HWSECallBack(data) {
    console.log('HWSECallBack');
  },

  //设置文档视图
  async SetShowView(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回文档视图
  async GetShowView(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870913;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置工具栏显示状态
  async SetShowToolBar(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '2;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取工具栏显示状态
  async GetShowToolBar(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870914;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置全屏显示状态
  async SetShowFullScreen(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '3;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回全屏显示状态
  async GetShowFullScreen(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870915;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前页索引（0,1,2,...）。
  async SetCurrPage(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '4;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置或返回当前页索引（0,1,2,...）。
  async GetCurrPage(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870916;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前文档的总页数
  async GetPageCount(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870917;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前笔的宽度(用户必须登录)。
  async SetCurrPenWidth(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '8;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前笔的宽度(用户必须登录)。
  async GetCurrPenWidth(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870920;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置操作状态。
  async CurrAction(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '6;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置控件菜单显示状态。
  async SetShowDefMenu(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '9;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回控件菜单显示状态。
  async GetShowDefMenu(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870921;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前版本号。
  async GetLVersion(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870922;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前文字平滑状态。
  async SetTextSmooth(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '11;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前文字平滑状态。
  async GetTextSmooth(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870923;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置当前压感灵敏度级别。
  async SetPressurelevel(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '12;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前压感灵敏度级别。
  async GetPressurelevel(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870924;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置滚动条状态。
  async SetShowScrollBarButton(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '13;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回滚动条状态。
  async GetShowScrollBarButton(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870925;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前文档类型（必须以LoadOriginalFile装入文档)。
  async GetCurrDocType(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870926;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前打开的文件的路径。
  async SetPathName(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '15;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前打开的文件的路径。
  async GetPathName(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870927;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置当前word文件的修订显示状态。此属性只针对word。
  async SetShowRevisions(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '20;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //退出或者进入修订状态
  async TractRevisions(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '18;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前word文件的修订显示状态。此属性只针对word。
  async GetShowRevisions(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870932;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置附加信息
  async SetAppendTipInfo(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '21;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回附加信息
  async GetAppendTipInfo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870933;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //加载文档
  async LoadFile(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '22;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置参数对应的内容
  async SetValue(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '23;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获得参数对应的值
  async GetValue(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '24;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //文件是否被修改
  async IsSaved(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '25;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //判断当前是否打开文件
  async IsOpened(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '26;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前打开的文件中的所有文字
  async GetDocText(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '27;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //修改节点的名称
  async ModifyName(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '28;|;3,' + p1 + '|;3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //判断当前是否登录
  async IsLogin(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '29;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前登录用户的用户名
  async GetCurrUserID(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '30;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前登录用户的远程地址
  async GetUserRemoteAddr(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '31;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取是否存在登录用户
  async IsUserExist(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '32;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取用户 pcUserID 的用户的相关信息
  async GetUserInfo(p1, p2, p3, p4, p5, p6, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '33;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3 + '|;|2,' + p4 + '|;|2,' + p5 + '|;|2,' + p6;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //显示或隐藏所有用户的节点信息
  async ShowAllNotes(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '34;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //文件另存
  async SaveTo(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '35;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取用户 pcUserID 的下一个用户ID
  async GetNextUser(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '127;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取用户 pcUserID 的下一个用户ID
  async JSGetNextUser(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '36;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //打印当前文档
  async PrintDoc(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '37;|;2,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //判断操作是否可以撤销
  async CanUndo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '38;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //判断操作是否可以恢复
  async CanRedo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '39;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //单步撤销操作
  async Undo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '40;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //单步恢复操作。
  async Redo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '41;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //撤销本次所有操作。
  async UndoAll(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '42;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //恢复所有撤销的操作。
  async RedoAll(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '43;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //关闭当前文档。
  async CloseDoc(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '44;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //登录当前系统。只有登录用户才可以对AIP文件进行操作(批注|盖章... ...)。
  async Login(p1, p2, p3, p4, p5, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '45;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|3,' + p4 + '|;|3,' + p5;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取下一个节点信息。
  async GetNextNote(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '46;|;3,' + p1 + '|;|2,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置页面显示模式。
  async SetPageMode(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '47;|;2,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取页面显示模式信息。JS环境下需调用JSGetPageMode
  async GetPageMode(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '48;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取原始文件
  async GetOriginalFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '49;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取原始文件名
  async GetOriginalFileName(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '50;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取原始文件个数
  async GetOriginalFileCount(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '51;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置特定用户的节点信息是否显示
  async SetUserVisible(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '53;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //添加当前文件的属性和值
  async AddDocProperty(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '54;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //删除文件属性
  async DelDocProperty(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '55;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取当前属性的下一个属性
  async GetNextDocProperty(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '56;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置通过Http上传的文件
  async HttpAddPostFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '57;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置通过Http上传的数字变量
  async HttpAddPostValue(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '58;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置通过Http上传的字符串变量
  async HttpAddPostString(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '59;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置通过Http上传的字符串变量
  async HttpAddPostBuffer(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '60;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|2,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //初始化Http,在调用Http的时候必须首先初始化
  async HttpInit(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '61;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //触发Http上传Post操作
  async HttpPost(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '62;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //连接FTP服务器
  async FtpConnect(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '63;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //断开FTP服务器连接
  async FtpDisConnect(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '64;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //通过FTP下载服务器文件
  async FtpGetFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '65;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //通过FTP上传本地文件
  async FtpPutFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '66;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置Http上传当前打开的AIP文件
  async HttpAddPostCurrFile(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '67;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //打开AIP文件, 如果打开的不是 AIP 文件, 将进行自动转化
  async LoadFileEx(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '68;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3 + '|;|2,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前用户的操作对特定用户的可见性
  async SetCurrUserVisibilityForUser(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '69;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置显示当前用户操作信息的密码。（只有当前登录用户才可以设置）。
  async SetCurrUserVisibilityPwd(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '70;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //显示文件属性。
  async ShowFileInfo(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '71;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //显示文件安全设置对话框
  async ShowFileSecurity(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '72;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //以原始文件打开方式打开或创建文件，不转化为aip文件
  async dispidLoadOriginalFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '74;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //隐藏指定菜单
  async HideMenuItem(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '75;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //保护或解除文档保护
  async ProtectDoc(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '76;|;2,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前用户的权限（请参阅方法Login）。
  async GetCurrUserAccess(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '78;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //拷贝当前选择的文字到剪贴板
  async CopySelectText(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '79;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //查找文字
  async SearchText(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '80;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //用户退出
  async Logout(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '81;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //修改当前用户的登陆密码   参数：原密码，新密码
  async ChangeCurrUserPwd(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '82;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //把当前通过LoadOriginalFile打开的原始文件直接转化成AIP文件 参数：blAddOri：0不装载，1装载原始文件 ，blNormal 0不解析文档的书签 1解析文档的书签
  async ConvertToAip(blAddOri, blNorma, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '84;|;2,' + blAddOri + '|;|2,' + blNorma;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //执行菜单快捷键操作 参数 lType
  async InputHotKey(lType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '85;|;2,' + lType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //用于登录AIP网络版服务器
  async LoginEx(pcRemoteAddr, pLoginData, lDataLen, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '87;|;3,' + pcRemoteAddr + '|;|3,' + pLoginData + '|;|3,' + lDataLen;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //创建空白页面，批示页，编辑页。(必须用户登录)
  async InsertEmptyPage(lPageIndex, lType, lWidth, lHeight, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '88;|;2,' + lPageIndex + '|;|2,' + lType + '|;|2,' + lWidth + '|;|2,' + lHeight;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //插入批示页。或者合并AIP文件(必须用户登录)。
  async MergeFile(lPageStartIndex, pcFileName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '89;|;2,' + lPageStartIndex + '|;|3,' + pcFileName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得当前服务序列号对应的服务名。我们为每一服务器用户分配了32位唯一表示符号。
  async GetCurrServer(plServerID, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '90;|;2,' + plServerID;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //如当前是通过LoadOriginalFile打开的原始文件，通过此接口可以接受文件的全部修订
  async AcceptAllRevisions(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '91;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置文档是否被修改
  async SetSaved(blSaved, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '92;|;2,' + blSaved;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前文件的Base64编码的字符串,与LoadFileBase64对应
  async GetCurrFileBase64(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '93;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //加载Base64编码的字符串
  async LoadFileBase64(pcBase64String, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '94;|;3,' + pcBase64String;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置书签的内容。只针对word和wps
  async SetFieldValue(strFieldName, strValue, strSheetName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '95;|;3,' + strFieldName + '|;|3,' + strValue + '|;|3,' + strSheetName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //添加骑缝章和普通印章接口（必须打开文件且用户已登录）
  async AddQifengSeal(lFrom, pcPages, pcOriSealName, pcSealName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '96;|;2,' + lFrom + '|;|3,' + pcPages + '|;|3,' + pcOriSealName + '|;|3,' + pcSealName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //打印文档，提供更详细的打印控制
  async PrintDocEx(
    strPrinterName,
    lPrintFlag,
    blShowDlg,
    blZoom,
    lFromPage,
    lToPage,
    blOriSize,
    lCopys,
    blCollate,
    blTranFirst,
    blDulpex,
    CallBack,
    CallData,
    ErrMsg,
    sMode,
  ) {
    var cmddata =
      '98;|;3,' +
      strPrinterName +
      '|;|2,' +
      lPrintFlag +
      '|;|2,' +
      blShowDlg +
      '|;|2,' +
      blZoom +
      '|;|2,' +
      lFromPage +
      '|;|2,' +
      lToPage +
      '|;|2,' +
      blOriSize +
      '|;|2,' +
      lCopys +
      '|;|2,' +
      blCollate +
      '|;|2,' +
      blTranFirst +
      '|;|2,' +
      blDulpex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //动态添加编辑域|手写域|超链接.(必须登录)。
  async InsertNote(pcName, lPageIndex, lType, lPosx, lPosy, lWidth, lHeight, CallBack, CallData, ErrMsg, sMode) {
    var cmddata =
      '99;|;3,' +
      pcName +
      '|;|2,' +
      lPageIndex +
      '|;|2,' +
      lType +
      '|;|2,' +
      lPosx +
      '|;|2,' +
      lPosy +
      '|;|2,' +
      lWidth +
      '|;|2,' +
      lHeight;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置添加区域的位置
  async SetNotePos(pcNoteName, lLeft, lTop, lWidth, lHeight, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '101;|;3,' + pcNoteName + '|;|2,' + lLeft + '|;|2,' + lTop + '|;|2,' + lWidth + '|;|2,' + lHeight;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //删除本地文件。
  async DeleteLocalFile(pcFileName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '102;|;3,' + pcFileName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //随机生成一个唯一的临时文件名。
  async GetTempFileName(pcFileType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '103;|;3,' + pcFileType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取节点个数。
  async GetNoteNum(lNoteType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '105;|;2,' + lNoteType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置各部门打印份数。可重复调用，本接口只有网络版有效
  async InsertDepartmentCopy(pcDepName, lCopys, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '106;|;3,' + pcDepName + '|;|2,' + lCopys;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //保留。
  async SetPrintCopyList(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '107;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //删除指定节点。
  async DeleteNote(strNoteName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '108;|;3,' + strNoteName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //使AIP文档中指定类型变成灰色
  async GrayData(lGrayType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '109;|;2,' + lGrayType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定节点或页面的旋转类型
  async GetRotateType(pcName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '110;|;3,' + pcName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置指定节点或页面的旋转类型。111    536871023 var cmddata = "87;|;3,"+pcRemoteAddr+"|;|3,"+pLoginData+"|;|3,"+lDataLen;
  async SetRotateType(pcName, sRotateType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '112;|;3,' + pcName + '|;|2,' + sRotateType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将AIP文件保存为TIFF格式。
  async SaveToTiff(pcFileName, xDPI, yDPI, nBpp, blGray, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '112;|;3,' + pcFileName + '|;|3,' + xDPI + '|;|2,' + yDPI + '|;|2,' + nBpp + '|;|2,' + blGray;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定节点的X逻辑坐标位置(坐标单位由CurrXYMode指定)。
  async GetNotePosX(pcName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '113;|;3,' + pcName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定节点的X逻辑坐标位置(坐标单位由CurrXYMode指定)。
  async GetNotePosY(pcName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '114;|;3,' + pcName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //根据错误ID来返回错误的信息
  async GetErrorString(lErrorNo, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '115;|;2,' + lErrorNo;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置参数对应的内容。
  async SetValueEx(pcName, lType, lParam, pParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '116;|;3,' + pcName + '|;|2,' + lType + '|;|2,' + lParam + '|;|3,' + pParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //查看文件、用户、节点进行保护限制的状态
  async IsProtect(pcName, lSource, lType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '117;|;3,' + pcName + '|;|2,' + lSource + '|;|2,' + lType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //查看文件、用户、节点进行保护限制的状态
  async GetNoteWidth(pcName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '118;|;3,' + pcName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定节点的逻辑高度(单位基于当前坐标系)。
  async GetNoteHeight(pcName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '119;|;3,' + pcName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指纹图片base64值。
  async GetValueEx(pcName, lValuetype, pcValueName, lParam, pcParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '120;|;3,' + pcName + '|;|2,' + lValuetype + '|;|3,' + pcValueName + '|;|2,' + lParam + '|;|3,' + pcParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定节点的逻辑高度(单位基于当前坐标系)。
  async MergerPage(pcName, lValuetype, pcValueName, lParam, pcParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '121;|;3,' + pcName + '|;|,2' + lValuetype + '|;|,3' + pcValueName + '|;|,3' + lParam + '|;|,2' + pcParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定页面的宽度(像素)。。
  async GetPageWidth(lPageIndex, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '122;|;2,' + lPageIndex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取指定页面的高度(像素)。。
  async GetPageHeight(lPageIndex, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '123;|;2,' + lPageIndex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前环境是否为JS环境
  async SetJSEnv(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '125;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回当前环境是否为JS环境
  async GetJSEnv(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871037;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前环境是否为JS环境
  async SetJSValue(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '126;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前环境是否为JS环境
  async GetJSValue(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871038;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回当前页面模式。并可通过JSValue查看缩放比例。
  async JSGetPageMode(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '128;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //显示消息提示对话框
  async ShowMessage(pcMessage, pcCaption, lType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '130;|;3,' + pcMessage + '|;|3,' + pcCaption + '|;|2,' + lType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //取得当前文件大小，单位字节。
  async GetCurrFileSize(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '131;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //取得目标文件大小，单位字节。
  async GetFileSize(strFilePath, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '132;|;3,' + strFilePath;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前智能卡的证书序列号。
  async GetSerialNumber(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '133;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将控件虚拟打印机设置为系统默认打印机，并保存原打印机设置。 在  AfterConvert  后恢复。
  async BeforeConvert(pcPaperName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '134;|;3,' + pcPaperName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //在BeforeConvert后，默认打印机恢复为原打印机，并读取设置。
  async AfterConvert(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '135;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //控件进入等待状态。
  async SleepSecond(lSecond, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '137;|;2,' + lSecond;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //对文件、用户、节点进行保护限制。
  async ProtectObject(pcName, lSource, lType, pcOld, pcNew, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '138;|;3,' + pcName + '|;|2,' + lSource + '|;|2,' + lType + '|;|3,' + pcOld + '|;|3,' + pcNew;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将宽度由原单位换算为新的单位。
  async ConvertXYModeW(lPageIndex, lW, lSXYMode, lDXYMode, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '139;|;2,' + lPageIndex + '|;|2,' + lW + '|;|2,' + lSXYMode + '|;|2,' + lDXYMode;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将高度由原单位换算为新的单位。
  async ConvertXYModeH(lPageIndex, lW, lSXYMode, lDXYMode, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '140;|;2,' + lPageIndex + '|;|2,' + lW + '|;|2,' + lSXYMode + '|;|2,' + lDXYMode;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取指定类型的用户信息
  async GetUserInfoEx(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '141;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置指定类型的用户信息
  async SetUserInfoEx(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '142;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|3,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置用户界面颜色
  async SetCustomColour(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '143;|;2,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获取用户界面颜色
  async GetCustomColour(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '144;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置水印模式
  async SetWaterMarkMode(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '146;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  async GetWaterMarkMode(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871058;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置水印透明度147
  async SetWaterMarkAlpha(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '147;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回水印透明度
  async GetWaterMarkAlpha(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871059;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置水印的内容
  async SetWaterMarkTextOrPath(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '148;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回水印的内容
  async GetWaterMarkTextOrPath(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871060;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置水印缩放比例
  async SetWaterMarkTxtHOrImgZoom(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '150;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回水印缩放比例
  async GetWaterMarkTxtHOrImgZoom(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871062;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置输出的水印在文档的x坐标位置
  async SetWaterMarkPosX(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '151;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回输出的水印在文档的x坐标位置
  async GetWaterMarkPosX(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871063;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置或返回输出的水印在文档的y坐标位置
  async SetWaterMarkPosY(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '152;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回输出的水印在文档的y坐标位置
  async GetWaterMarkPosY(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871064;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置输出的水印文字颜色设置或返回输出的水印文字颜色
  async SetWaterMarkTextColor(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '153;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回输出的水印文字颜色设置或返回输出的水印文字颜色
  async GetWaterMarkTextColor(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871065;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置水印旋转角度（X0.1度）。
  async SetWaterMarkAngle(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '154;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回水印旋转角度（X0.1度）。
  async GetWaterMarkAngle(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871066;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置页面位置单位类型值
  async SetCurrXYMode(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '155;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回页面位置单位类型值
  async GetCurrXYMode(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871067;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //删除指定页面
  async DeletePage(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '158;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前系统时间
  async SetCurrTime(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '160;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置设计模式
  async SetInDesignMode(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '161;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //返回设计模式
  async GetInDesignMode(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536871073;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //插入图片（用户必须登录）。
  async InsertPicture(pcPicName, pcPicValue, lPage, lLeft, lTop, lZoom, CallBack, CallData, ErrMsg, sMode) {
    var cmddata =
      '162;|;3,' + pcPicName + '|;|3,' + pcPicValue + '|;|2,' + lPage + '|;|2,' + lLeft + '|;|2,' + lTop + '|;|2,' + lZoom;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //插入节点
  async InsertNoteEx(pcName, lNoteType, lTagType, pcTagName, lLevel, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '163;|;3,' + pcName + '|;|2,' + lNoteType + '|;|2,' + lTagType + '|;|3,' + pcTagName + '|;|2,' + lLevel;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //执行控件内部菜单
  async RunCommand(lCmdType, lCmdCode, lRunMode, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '164;|;2,' + lCmdType + '|;|2,' + lCmdCode + '|;|2,' + lRunMode;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置当前编辑用户。这个名称会显示在附加用户信息的编辑框里
  async SetCurrTextEditUser(lCmdType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '166;|;3,' + lCmdType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //将对应的页保存为相应类型图片，以字符串方式返回
  async SaveAsBase64(
    pcSaveType,
    lPageStart,
    lPageEnd,
    lPageWidth,
    lPageHeight,
    lZoomPercent,
    pcReserve,
    CallBack,
    CallData,
    ErrMsg,
    sMode,
  ) {
    var cmddata =
      '167;|;3,' +
      pcSaveType +
      '|;|2,' +
      lPageStart +
      '|;|2,' +
      lPageEnd +
      '|;|2,' +
      lPageWidth +
      '|;|2,' +
      lPageHeight +
      '|;|2,' +
      lZoomPercent +
      '|;|3,' +
      pcReserve;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将控件虚拟打印机设置为系统默认打印机，并保存原打印机设置。 在AfterConvert后恢复
  async BeforeConvertEx(lPaperWidth, lPaperHeight, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '169;|;2,' + lPaperWidth + '|;|2,' + lPaperHeight;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //插入节点
  async InsertNote2(
    pcName,
    lNoteType,
    pcValue,
    lStartPage,
    lEndPage,
    lTagType,
    pcTagName,
    lOffset,
    lZoom,
    CallBack,
    CallData,
    ErrMsg,
    sMode,
  ) {
    var cmddata =
      '170;|;3,' +
      pcName +
      '|;|2,' +
      lNoteType +
      '|;|3,' +
      pcValue +
      '|;|2,' +
      lStartPage +
      '|;|2,' +
      lEndPage +
      '|;|2,' +
      lTagType +
      '|;|3,' +
      pcTagName +
      '|;|2,' +
      lOffset +
      '|;|2,' +
      lZoom;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //显示文件选择框
  async ShowDialog(lDialogType, pcTitle, pcInitValue, pcFilter, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '171;|;2,' + lDialogType + '|;|3,' + pcTitle + '|;|3,' + pcInitValue + '|;|3,' + pcFilter;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //校验文档中的节点
  async VerifyNotes(pcNoteName, pcParam, lParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '172;|;3,' + pcNoteName + '|;|3,' + pcParam + '|;|2,' + lParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取原始文档类型
  async GetOriginalFileType(lOriginalIndex, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '173;|;2,' + lOriginalIndex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前的证书序列号
  async GetCurrSerialNumber(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '175;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前证书授予者名称
  async GetCurrSubjectName(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '176;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前证书授予者名称
  async GetHttpPostData(lParam, strParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '177;|;2,' + lParam + '|;|3,' + strParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前证书授予者名称
  async SetBackgroundDoc(pcFileNameOrUrl, pcType, lPageIndex, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '178;|;3,' + pcFileNameOrUrl + '|;|3,' + pcType + '|;|2,' + lPageIndex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //定位到参数指定的位置
  async GotoPosition(lType, pcName, lPageIndex, lPosX, lPosY, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '179;|;2,' + lType + '|;|3,' + pcName + '|;|2,' + lPageIndex + '|;|2,' + lPosX + '|;|2,' + lPosY;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取当前证书授予者名称
  async GetBMPos(strBMName, lPosType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '180;|;3,' + strBMName + '|;|2,' + lPosType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //部分保护word文档内容。
  async PartialProtect(strPosList, strPWD, strParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '181;|;3,' + strPosList + '|;|3,' + strPWD + '|;|3,' + strParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取文件的base64串。
  async GetFileBase64(strFilePath, blCompress, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '182;|;3,' + strFilePath + '|;|2,' + blCompress;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将base64解开并存储到本地文件。
  async SaveBinaryFileFromBase64(strFilePath, strBase64, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '183;|;3,' + strFilePath + '|;|3,' + strBase64;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得指定目录下的所有文件列表。
  async GetFileListUnderDir(pcDir, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '184;|;3,' + pcDir;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //导出文档中所有区域的字符串数据。
  async ExportEditNodeValue(pcOpenFileName, pcSaveFileName, lWithHeader, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '189;|;3,' + pcOpenFileName + '|;|3,' + pcSaveFileName + '|;|2,' + lWithHeader;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得所有打印机。
  async GetPrinterList(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '190;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得打印机的任务列表和状态。
  async GetPrinterStatusByStr(pcPrintName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '191;|;3,' + pcPrintName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得打印机的任务详细信息。
  async GetJobInfoByStr(pcPrintName, dwJobID, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '192;|;3,' + pcPrintName + '|;|2,' + dwJobID;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得打印机的任务详细信息。
  async ResetPrinterByStr(pcPrintName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '193;|;3,' + pcPrintName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //对指定字符串数据签名(GBK编码) 。
  async SignData(pcData, pcPin, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '194;|;3,' + pcData + '|;|3,' + pcPin;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //校验针对指定字符串数据的签名(GBK编码)。
  async VerifyData(pcData, pcSignData, pcCert, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '195;|;3,' + pcData + '|;|3,' + pcSignData + '|;|3,' + pcCert;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将当前文档的指定页保存。（暂时仅支持保存为PDF）
  async SplitPages(pcPages, pcSavePath, pcSaveType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '197;|;3,' + pcPages + '|;|3,' + pcSavePath + '|;|3,' + pcSaveType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //（保留）。
  async VerifyDocText(pcPages, pcBorderText, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '198;|;3,' + pcPages + '|;|3,' + pcBorderText;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得文档窗口的指定位置在页面上的坐标。
  async GetCurrPagePos(lPagePosType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '199;|;2,' + lPagePosType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置指定页面的位置到指定窗口位置。
  async SetCurrPagePos(lPagePosType, pcPagePos, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '200;|;2,' + lPagePosType + '|;|3,' + pcPagePos;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //查找指定文字并返回文字位置。
  async FindText(p1, p2, p3, p4, p5, p6, p7, p8, p9, CallBack, CallData, ErrMsg, sMode) {
    var cmddata =
      '201;|;3,' +
      p1 +
      '|;|2,' +
      p2 +
      '|;|2,' +
      p3 +
      '|;|2,' +
      p4 +
      '|;|2,' +
      p5 +
      '|;|2,' +
      p6 +
      '|;|2,' +
      p7 +
      '|;|2,' +
      p8 +
      '|;|2,' +
      p9;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //设置书签的选择信息（保留）。
  async SetFieldShowInfo(p1, p2, p3, p4, p5, p6, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '202;|;3,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|2,' + p4 + '|;|2,' + p5 + '|;|2,' + p6;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //隐藏指定工具条按钮
  async HideBarItems(p1, p2, p3, p4, p5, p6, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '203;|;2,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|2,' + p4 + '|;|2,' + p5 + '|;|2,' + p6;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //判定是否为空白文档。
  async IsEmptyDoc(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '204;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //异步打开原始文件
  async LoadOriginalFileAsync(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '205;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //判定是否为空白文档。
  async LoadFileExAsync(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '206;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3 + '|;|2,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async ZipDir(p1, p2, p3, p4, p5, p6, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '207;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|2,' + p4 + '|;|3,' + p5 + '|;|3,' + p6;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //解压缩。
  async UnzipFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '208;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //加密文件。
  async UnEncFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '209;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //解密文件
  async UnDecFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '210;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //更新所有的word书签域（保留）。
  async UpdateAllField(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '211;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async SaveLoadOri(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '212;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async ShowPaperFile(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '213;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async ClosePaperFile(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '214;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async AddSealByDir(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '215;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|3,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async LoadBinary(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '218;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|3,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //（保留）。
  async ForceSignType4(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '219;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|3,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //将数据写入文件。
  async WriteLocalFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '220;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //读取文件数据
  async ReadLocalFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '221;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //加入当前文件到待上传列表
  async HttpAddPostCurrFileEx(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '222;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //开始下载文件
  async StartDownloadFile(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '223;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //停止当前的异步下载线程
  async StopDownloadFile(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '224;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //创建文件夹
  async CreateFolder(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '225;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //删除文件夹
  async DeleteFolder(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '226;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //拷贝本地文件
  async CopyLocalFile(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '227;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //根据序号获得节点
  async GetNoteByIndex(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '228;|;2,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //执行shell命令
  async ExecuteCmd(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '232;|;3,' + p1 + '|;|3,' + p2 + '|;|2,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //插入附件
  async InsertEmbFile(p1, p2, p3, p4, p5, p6, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '234;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|2,' + p4 + '|;|2,' + p5 + '|;|2,' + p6;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //获得sheet数量（excel）。
  async GetSheetCount(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '235;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得sheet名称（excel）。
  async GetSheetName(lSheetIndex, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '236;|;2,' + lSheetIndex;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //根据Sheet名称获得sheet序号
  async GetSheetIndex(pcSheetName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '237;|;3,' + pcSheetName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得指定范围的文字（excel）。
  async GetSheetRangeText(lSheetIndex, pcRngName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '238;|;2,' + lSheetIndex + '|;|3,' + pcRngName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得指定范围的值（excel）。
  async GetSheetRangeValue(lSheetIndex, pcRngName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '239;|;2,' + lSheetIndex + '|;|3,' + pcRngName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获得指定范围的公式（excel）。
  async GetSheetRangeFormula(lSheetIndex, pcRngName, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '240;|;2,' + lSheetIndex + '|;|3,' + pcRngName;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //保护或者解除保护指定的sheet（excel）。
  async ProtectSheet(lSheetIndex, pcPwd, blProtect, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '241;|;2,' + lSheetIndex + '|;|3,' + pcPwd + '|;|2,' + blProtect;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //保护或者解除保护指定的sheet（excel）。
  async IsFolderExist(strFolder, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '242;|;3,' + strFolder;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //返回文件的修改/创建日期
  async GetFileInfo(strFilePath, lType, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '243;|;3,' + strFilePath + '|;|2,' + lType;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //获取vba接口对象
  async GetDocumentObject(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '83;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*设置笔颜色*/
  async SetCurrPenColor(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '7;|;2,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  /*获取笔颜色*/
  async GetCurrPenColor(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870919;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  /**/
  async IsOpening(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '86;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  /**/
  async ConvertFileTo(p1, p2, p3, p4, p5, p6, p7, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '251;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|3,' + p4 + '|;|3,' + p5 + '|;|3,' + p6 + '|;|2,' + p7;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  /**/
  async GetCurrAction(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '536870918;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  /*idEncFile= 209;  idEncFile2 = 230; 如果不行换另一个id试试*/
  async PwdEncFile(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '230;|;3,' + p1 + '|;|3,' + p2 + '|;|3,' + p3 + '|;|2,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /************************************
   ***************默认回调函数**************
   ************************************/
  async HWCallBack(data) {
    console.log('HWCallBack');
  },

  async ShowAipWndMax(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '991;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  async ShowAipWndToSec(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '992;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  async ShowAipWndToSecMax(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '993;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  async HideAipWnd(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '994;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*嵌入模式专用：关闭内嵌的控件窗口*/
  async dispidExitWnd(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '995;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置winaip_serv窗口显示层级   参数为1表示始终置顶层  2表示显示在最外层但可以被新窗口遮挡  0退出置顶
  async SetDispidShowWndLevel(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '996;|;2,' + p1;
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
  //设置隐藏状态栏1是隐藏，0是显示
  disidSetShowScrollBarButton(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '13;|;2,' + p1;
    var str = aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //设置显示窗口大小四个整数参数:x,y,w,h屏幕坐标
  async SetDispidShowWndPos(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '997;|;2,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|2,' + p4;
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
  //设置是否可以点击×
  async dispidEnableCloseBtn(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '998;|;2,' + p1;
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
  //隐藏或者显示winaip上面地址栏
  async SetDispidHideTitle(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '999;|;2,' + p1;
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
  //判断服务是否启动
  async CheckApp(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1000;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*嵌入模式专用：五个整数参数:目标程序类型(BIND_xxx),x,y,w,h坐标*/
  async BindAipWnd(nMode, nx, ny, nw, nh, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1004;|;2,' + nMode + '|;|2,' + nx + '|;|2,' + ny + '|;|2,' + nw + '|;|2,' + nh;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*嵌入模式专用：显示窗口,x,y,w,h坐标*/
  async MoveWndPos(p1, p2, p3, p4, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1005;|;2,' + p1 + '|;|2,' + p2 + '|;|2,' + p3 + '|;|2,' + p4;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*嵌入模式专用：显示在指定位置,或者0个参数直接显示*/
  async ShowWnd(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '990;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  /*nMode为DSP_MODE_xxx项，nWRadio, nHRadio为百分比*/
  async ShowAipWnd(nMode, nWRadio, nHRadio, CallBack, CallData, ErrMsg, sMode) {
    var cmddata;
    if (commonJS.PlatForm() == 'Linux') cmddata = '1006;|;2,' + nMode + '|;|2,' + nWRadio + '|;|2,' + nHRadio;
    else cmddata = '990;|;2,' + nMode + '|;|2,' + nWRadio + '|;|2,' + nHRadio;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },
  //dispidShowWM = 1002L,//string cWateText, int nTextHeight(建议为48),  int nWaterX(建议为0),  int nWaterY(建议为0),  int nWaterAngle(建议为-45),  int nWaterShadow(建议为0),  int nWaterWndMode(0:aipServerJs window,1:topall screen mode)
  //屏幕水印 前两个参数必须
  async setdispidShowWM(
    cWateText,
    nTextHeight,
    nWaterX,
    nWaterY,
    nWaterAngle,
    nWaterShadow,
    nWaterWndMode,
    CallBack,
    CallData,
    ErrMsg,
    sMode,
  ) {
    console.log(123);
    var cmddata =
      '1002L;|;3,' +
      cWateText +
      '|;|2,' +
      nTextHeight +
      '|;|2,' +
      nWaterX +
      '|;|2,' +
      nWaterY +
      '|;|2,' +
      nWaterAngle +
      '|;|2,' +
      nWaterShadow +
      '|;|2,' +
      nWaterWndMode;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);

    return str;
  },

  async dispidExitApp(CallBack, CallData, ErrMsg) {
    var cmddata = '1006;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg);
    return str;
  },

  /**dispidReopenApp = 1007L*/
  async dispidReopenApp(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1007;|;3,' + p1;
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  /**dispidGetSysDPI = 1008L,*/
  async dispidGetSysDPI(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1008;|;';
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  /********************************************
   *****Linux接口****
   *******************************************/
  async InitUsage(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1003;|;';
    aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async getSealList(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1007;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async getSealImage(dId, sId, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1008;|;3,' + dId + '|;|3,' + sId;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async getSealData(dId, sId, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1009;|;3,' + dId + '|;|3,' + sId;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async ExitApp_Linux(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1010;|;';
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async ReopenApp_Linux(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '1011;|;';
    return await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async SaveFile_Linux(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'saveFile;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async PrintDoc_Linux(p1, p2, p3, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = '37;|;2,' + p1 + '|;|2,' + p2 + '|;|3,' + p3;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //追踪水印
  async AddTrackInfo_Linux(xmlParam, sImgData, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'addTrackInfo;|;3,' + xmlParam + '|;|3,' + sImgData;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async DelTrackInfo_Linux(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'clearTrackInfo;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //动态水印
  async AddDynamicWaterMark_Linux(p1, CallBack, CallData, ErrMsg, sMode) {
    var sTmp = 'setDynamicWaterMark;|;3,' + p1;
    // var cmddata = encodeURIComponent(sTmp).replace("\+",/%20/g);
    var str = await aipServerJs.ConnectServ(sTmp, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async DelWaterMarkOfTrackInfo_Linux(CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'clearDynamicWaterMark;|;';
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  //文字水印
  async AddWaterMarkAnnot_Linux(xmlParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'addWaterMakerAnnot;|;3,' + xmlParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async DelWaterMakerAnnot_Linux(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'delWaterMakerAnnot;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
  //图片水印
  async AddWaterImageAnnot_Linux(xmlParam, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'addWaterImageAnnot;|;3,' + xmlParam;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
    return str;
  },

  async DelWaterMakerAnnotByID_Linux(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'delWaterMakerAnnot;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async performClick_Linux(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'performClick;|;3,' + p1 + '|;|2,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async setUserToken_Linux(p1, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'setUserToken;|;3,' + p1;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },

  async setHeaderInfo_Linux(p1, p2, CallBack, CallData, ErrMsg, sMode) {
    var cmddata = 'setHeaderInfo;|;3,' + p1 + '|;|3,' + p2;
    var str = await aipServerJs.ConnectServ(cmddata, CallBack, CallData, ErrMsg, sMode);
  },
};

export default aipServerJs;

// var   idSetShowView = 1;
// var   idGetShowView = 536870913;
// var   idSetShowToolBar = 2;
// var   idGetShowToolBar = 536870914;
// var   idGetShowFullScreen = 3;
// var   idSetShowFullScreen = 536870915;
// var   idSetCurrPage = 4;
// var   idGetCurrPage = 536870916;
// var   idGetPageCount = 5;
// var   idSetCurrAction = 6;
// var   idGetCurrAction = 536870918;
// var   idSetCurrPenColor = 7;
// var   idGetCurrPenColor = 536870919;
// var   idSetCurrPenWidth = 8;
// var   idGetCurrPenWidth = 536870920;
// var   idSetShowDefMenu = 9;
// var   idGetShowDefMenu = 536870921;
// var   idGetLVersion = 10;
// var   idSetTextSmooth = 11;
// var   idGetTextSmooth = 536870923;
// var   idSetPressurelevel = 12;
// var   idGetPressurelevel = 536870924;
// var   idSetShowScrollBarButton = 13;
// var   idGetShowScrollBarButton = 536870925;
// var   idGetCurrDocType = 14;
// var   idSetPathName = 15;
// var   idGetPathName = 536870927;
// var   idEnableHotKey = 16;
// var   idForceSignType = 17;
// var   idTrackRevisions = 18;
// var   idProtectType = 19;
// var   idSetShowRevisions = 20;
// var   idGetShowRevisions = 536870932;
// var   idSetAppendTipInfo=21;
// var   idGetSetAppendTipInfo=536870933;
// var   idLoadFile = 22;
// var   idSetValue = 23;
// var   idGetValue = 24;
// var   idIsSaved = 25;
// var   idIsOpened = 26;
// var   idGetDocText = 27;
// var   idModifyName = 28;
// var   idIsLogin = 29;
// var   idGetCurrUserID = 30;
// var   idGetUserRemoteAddr = 31;
// var   idIsUserExist = 32;
// var   idGetUserInfo = 33;
// var   idShowAllNotes = 34;
// var   idSaveTo = 35;
// var   idGetNextUser = 36;
// var   idPrintDoc = 37;
// var   idCanUndo = 38;
// var   idCanRedo = 39;
// var   idUndo = 40;
// var   idRedo = 41;
// var   idUndoAll = 42;
// var   idRedoAll = 43;
// var   idCloseDoc = 44;
// var   idLogin = 45;
// var   idGetNextNote = 46;
// var   idSetPageMode = 47;
// var   idGetPageMode = 48;
// var   idGetOriginalFile = 49;
// var   idGetOriginalFileName = 50;
// var   idGetOriginalFileCount = 51;
// var   idInternalCmd = 52;
// var   idSetUserVisible = 53;
// var   idAddDocProperty = 54;
// var   idDelDocProperty = 55;
// var   idGetNextDocProperty = 56;
// var   idHttpAddPostFile = 57;
// var   idHttpAddPostValue = 58;
// var   idHttpAddPostString = 59;
// var   idHttpAddPostBuffer = 60;
// var   idHttpInit=61;
// var   idHttpPost=62;
// var   idFtpConnect=63;
// var   idFtpDisConnect=64;
// var   idFtpGetFile=65;
// var   idFtpPutFile=66;
// var   idHttpAddPostCurrFile=67;
// var   idLoadFileEx=68;
// var   idSetCurrUserVisibilityForUser=69;
// var   idSetCurrUserVisibilityPwd=70;
// var   idShowFileInfo=71;
// var   idShowFileSecurity=72;
// var   idLoadOriginalFile=74;
// var   idHideMenuItem=75;
// var   idProtectDoc=76;
// var   idDrawFirstPage = 77;
// var   idGetCurrUserAccess=78;
// var   idCopySelectText=79;
// var   idSearchText=80;
// var   idLogout = 81;
// var   idChangeCurrUserPwd = 82;
// var   idGetDocumentObject = 83;
// var   idConvertToAip = 84;
// var   idInputHotKey = 85;
// var   idIsOpening = 86;
// var   idLoginEx = 87;
// var   idInsertEmptyPage = 88;
// var   idMergeFile = 89;
// var   idGetCurrServer = 90;
// var   idAcceptAllRevisions = 91;
// var   idSetSaved = 92;
// var   idGetCurrFileBase64 = 93;
// var   idLoadFileBase64 = 94;
// var   idSetFieldValue = 95;
// var   idAddQifengSeal = 96;
// var   idPageSetupSet = 97;
// var   idPrintDocEx = 98;
// var   idInsertNote = 99;
// var   idGetNotePos = 100;
// var   idSetNotePos = 101;
// var   idDeleteLocalFile = 102;
// var   idGetTempFileName = 103;
// var   idRemoteAddr = 104;
// var   idGetNoteNum = 105;
// var   idInsertDepartmentCopy = 106;
// var   idSetPrintCopyList = 107;
// var   idDeleteNote = 108;
// var   idGrayData = 109;
// var   idGetRotateType = 110;
// var   idSetRotateType = 111;
// var   idSaveToTiff = 112;
// var   idGetNotePosX = 113;
// var   idGetNotePosY = 114;
// var   idGetErrorString = 115;
// var   idSetValueEx = 116;
// var   idIsProtect = 117;
// var   idGetNoteWidth = 118;
// var   idGetNoteHeight = 119;
// var   idGetValueEx = 120;
// var   idMergerPage = 121;
// var   idGetPageWidth = 122;
// var   idGetPageHeight = 123;
// var   idDocProperty = 124;
// var   idSetJSEnv = 125;
// var   idGetJSEnv = 536871037;
// var   idSetJSValue = 126;
// var   idGetJSValue = 536871038;
// var   idJSGetNextUser = 127
// var   idJSGetPageMode = 128;
// var   idJSGetCurrServer = 129;
// var   idShowMessage = 130;
// var   idGetCurrFileSize = 131;
// var   idGetFileSize = 132;
// var   idGetSerialNumber = 133;
// var   idBeforeConvert = 134;
// var   idAfterConvert = 135;
// var   idWaitConverting = 136;
// var   idSleepSecond = 137;
// var   idProtectObject = 138;
// var   idConvertXYModeW = 139;
// var   idConvertXYModeH = 140;
// var   idGetUserInfoEx = 141;
// var   idSetUserInfoEx = 142;
// var   idSetCustomColour = 143;
// var   idGetCustomColour = 144;
// var   idLastError = 145;
// var   idSetWaterMarkMode = 146;
// var   idGetWaterMarkMode = 536871058;
// var   idSetWaterMarkAlpha = 147;
// var   idGetWaterMarkAlpha = 536871059;
// var   idSetWaterMarkTextOrPath = 148;
// var   idGetWaterMarkTextOrPath = 536871060;
// var   idSetWaterMarkAddition = 149;
// var   idGetWaterMarkAddition = 536871061;
// var   idSetWaterMarkTxtHOrImgZoom = 150;
// var   idGetWaterMarkTxtHOrImgZoom = 536871062;
// var   idSetWaterMarkPosX = 151;
// var   idGetWaterMarkPosX = 536871063;
// var   idSetWaterMarkPosY = 152;
// var   idGetWaterMarkPosY = 536871064;
// var   idSetWaterMarkTextColor = 153;
// var   idGetWaterMarkTextColor = 536871065;
// var   idSetWaterMarkAngle = 154;
// var   idGetWaterMarkAngle = 536871066;
// var   idSetCurrXYMode = 155;
// var   idGetCurrXYMode = 536871067;
// var   idSilentMode = 156;
// var   idPdfDllAddr = 157;
// var   idDeletePage = 158;
// var   idShowErrMsgMode = 159;
// var   idSetCurrTime = 160;
// var   idSetInDesignMode=161;
// var   idGetInDesignMode=536871073;//536870912
// var   idInsertPicture=162;
// var   idInsertNoteEx = 163;
// var   idRunCommand = 164;
// var   idInTabSortMode = 165;
// var   idSetCurrTextEditUser = 166;
// var   idGetCurrTextEditUser = 536871078;//536870912
// var   idSaveAsBase64 = 167;
// var   idCurrTextEditPRI = 168;
// var   idBeforeConvertEx = 169;
// var   idInsertNote2 = 170;
// var   idShowDialog = 171;
// var   idVerifyNotes = 172;
// var   idGetOriginalFileType = 173;
// var   idForceSignType2 = 174;
// var   idGetCurrSerialNumber = 175;
// var   idGetCurrSubjectName = 176;
// var   idGetHttpPostData = 177;
// var   idSetBackgroundDoc = 178;
// var   idGotoPosition = 179;
// var   idGetBMPos = 180;
// var   idPartialProtect = 181;
// var   idGetFileBase64 = 182;
// var   idSaveBinaryFileFromBase64 = 183;
// var   idGetFileListUnderDir = 184;
// var   idStartDrawDoc = 185;
// var   idStartDrawPage = 186;
// var   idEndDrawPage = 187;
// var   idEndDrawDoc = 188;
// var   idExportEditNodeValue = 189;
// var   idGetPrinterList = 190;
// var   idGetPrinterStatusByStr = 191;
// var   idGetJobInfoByStr = 192;
// var   idResetPrinterByStr = 193;
// var   idSignData = 194;
// var   idVerifyData = 195;
// var   idForceSignType3 = 196;
// var   idSplitPages = 197;
// var   idVerifyDocText = 198;
// var   idGetCurrPagePos = 199;
// var   idSetCurrPagePos = 200;

// var   idFindText = 201;
// var   idSetFieldShowInfo = 202;
// var   idHideBarItems= 203;
// var   idIsEmptyDoc= 204;
// var   idLoadOriginalFileAsync= 205;
// var   idLoadFileExAsync= 206;
// var   idZipDir= 207;
// var   idUnzipFile= 208;
// var   idEncFile= 209;
// var   idDecFile= 210;
// var   idUpdateAllField = 211;
// var   idSaveLoadOri = 212;
// var   idShowPaperFile = 213;
// var   idClosePaperFile = 214;
// var   idAddSealByDir = 215;
// var   idPlayFlash = 216;
// var   idCurrCertDN = 217;
// var   idLoadBinary = 218;
// var   idForceSignType4 = 219;
// var   idWriteLocalFile = 220;
// var   idReadLocalFile = 221;
// var   idHttpAddPostCurrFileEx = 222;
// var   idStartDownloadFile = 223;
// var   idStopDownloadFile = 224;
// var   idCreateFolder = 225;
// var   idDeleteFolder = 226;
// var   idCopyLocalFile = 227;
// var   idGetNoteByIndex = 228;
// var   idSaveBinary = 229;  //返回一个byte数组
// var   idEncFile2 = 230;
// var   idDecFile2 = 231;
// var   idExecuteCmd = 232;
// var   idSetPrnBarInfo = 233;
// var   idInsertEmbFile = 234;
// var   idGetSheetCount = 235;
// var   idGetSheetName = 236;
// var   idGetSheetIndex = 237;
// var   idGetSheetRangeText = 238;
// var   idGetSheetRangeValue = 239;
// var   idGetSheetRangeFormula = 240;
// var   idProtectSheet = 241;
// var   idIsFolderExist = 242;
// var   idGetFileInfo = 243;
// var   idInsertXmlFilePage = 244;
// var   idDeleteFolderEx = 245;
// var   idReplaceText = 246;
// var   idGetRevCount = 247;
// var   idGetRevInfo = 248;
// var   idGetBookMarkCount = 249;
// var   idGetBookMarkInfo = 250;
// var   idConvertFileTo = 251;

// var   idShowWnd = 990;
// var   idShowMax = 991;
// var   idShowToSec = 992;
// var   idShowToSecMax = 993;
// var   idHideWnd = 994;

// var   idSetDispidShowWndLevel = 996;
// var   idSetDispidShowWndPos = 997;
// var   iddispidEnableCloseBtn = 998;
// var   idSetDispidHideTitle = 999;
// var   idCheckApp = 1000;
// var dispidShowWM = "1002L";//屏幕水印

// var DSP_MODE_PRIMARY_MAX		= 1;
// var DSP_MODE_PRIMARY_LEFTTOP	= 2;
// var DSP_MODE_PRIMARY_LEFTCENTER	= 3;
// var DSP_MODE_PRIMARY_LEFTBOTTOM	= 4;
// var DSP_MODE_PRIMARY_RIGHTTOP	= 5;
// var DSP_MODE_PRIMARY_RIGHTCENTER= 6;
// var DSP_MODE_PRIMARY_RIGHTBOTTOM= 7;
// var DSP_MODE_PRIMARY_MIDDLETOP	= 8;
// var DSP_MODE_PRIMARY_MIDDLECENTER= 9;
// var DSP_MODE_PRIMARY_MIDDLEBOTTOM= 10;
// var DSP_MODE_SEC_MAX			= 11;
// var DSP_MODE_SEC_LEFTTOP		= 12;
// var DSP_MODE_SEC_LEFTCENTER		= 13;
// var DSP_MODE_SEC_LEFTBOTTOM		= 14;
// var DSP_MODE_SEC_RIGHTTOP		= 15;
// var DSP_MODE_SEC_RIGHTCENTER	= 16;
// var DSP_MODE_SEC_RIGHTBOTTOM	= 17;
// var DSP_MODE_SEC_MIDDLETOP		= 18;
// var DSP_MODE_SEC_MIDDLECENTER	= 19;
// var DSP_MODE_SEC_MIDDLEBOTTOM	= 20;

// /*事件id
// [id(1)] void NotifyClick(BSTR pcName);
// [id(2)] void NotifyChangeValue(BSTR pcName, BSTR pcNewValue);
// [id(3)] void NotifyReset(BSTR pcName);
// [id(4)] void NotifySumbit(BSTR pcName);
// [id(5)] void NotifyDocOpened(long lOpenResult);
// [id(6)] void NotifyChangePage();
// [id(7)] void NotifyChangeCurrUser();
// [id(8)] void NotifyCloseDoc();
// [id(9)] void NotifyChangePenColor();
// [id(10)] void NotifyChangePenWidth();
// [id(11)] void NotifyCtrlReady();
// [id(12)] void NotifyMenuMsg(long lCmd, long* plContinue);
// [id(13)] void NotifyModifyStatus();
// [id(14)] void NotifyFullScreen();
// [id(15)] void NotifyPosChange(BSTR pcNoteName);
// [id(16)] void NotifySelect(BSTR pcName, long lNoteType);
// [id(17)] void JSNotifyMenuMsg(long lCmd);
// [id(18)] void NotifyBeforeAction(long lActionType, long lType, BSTR strName, BSTR strValue, long* plContinue);
// [id(19)] void JSNotifyBeforeAction(long lActionType, long lType, BSTR strName, BSTR strValue);
// [id(20)] void NotifyLineAction(long lPage, long lStartPos, long lEndPos);
// [id(21)] void NotifyDocumentEvent(BSTR strName);
// [id(22)] void NotifyAfterAction(long lActionType, long lType, BSTR strName, BSTR strValue);
// [id(23)] void NotifyChangeStatus(long lStatusType);
// [id(24)] void NotifyPressPen(long lScreenX, long lScreenY, long lPress);
// [id(25)] void NotifyAsyncCall(long lCallID, long lRet, BSTR strRet);
// [id(30)] aip窗口关闭事件
// */
